//
//  PKRadioDetailHeadView.m
//  PianKe
//
//  Created by lanou on 15/10/6.
//  Copyright (c) 2015年 李伟伟. All rights reserved.
//

#import "PKRadioDetailHeadView.h"
#import <UIImageView+WebCache.h>
@implementation PKRadioDetailHeadView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _coverimgView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0,SCREEN_WITDTH, SCREEN_HEIGHT/5)];
        _iconView = [[UIImageView alloc]initWithFrame:CGRectMake(20, SCREEN_HEIGHT/5 + 10, 30, 30)];
        _iconView.layer.cornerRadius = 15;
        
        _unameLabel = [[UILabel alloc]initWithFrame:CGRectMake(60, SCREEN_HEIGHT/5 + 15, 60, 20)];
        _unameLabel.font = [UIFont systemFontOfSize:12];
        _descLabel = [[UILabel alloc]initWithFrame:CGRectMake(20, SCREEN_HEIGHT/5 + 45, SCREEN_WITDTH-20, 20)];
        _descLabel.font = [UIFont systemFontOfSize:10];
        _soundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"声音"]];
        _soundView.frame = CGRectMake(SCREEN_WITDTH-80, SCREEN_HEIGHT/5 + 15, 20, 20);
        
        _musicvisitnumLabel = [[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WITDTH-55, SCREEN_HEIGHT/5 + 15, 55, 20)];
        _musicvisitnumLabel.font = [UIFont systemFontOfSize:10];
        [self addSubview:_coverimgView];
        [self addSubview:_iconView];
        [self addSubview:_unameLabel];
        [self addSubview:_descLabel];
        [self addSubview:_soundView];
        [self addSubview:_musicvisitnumLabel];
        
    }
    return self;
}

-(void)configureDetailModel:(NSMutableDictionary *)dic
{

   
    [_coverimgView sd_setImageWithURL:[NSURL URLWithString:dic[@"coverimg"]]];
    [_iconView sd_setImageWithURL:[NSURL URLWithString:dic[@"userinfo"][@"icon"]]];
    _unameLabel.text = dic[@"userinfo"][@"uname"];
    _descLabel.text = dic[@"desc"];
    _musicvisitnumLabel.text = [NSString stringWithFormat:@"%@", dic[@"musicvisitnum"]];
    
    
    
    
}
@end
